import {buildAbsAdminEcharts} from "@/assets/echarts/js/absEcharts.js";

export let absAdminPie_option = {
    title: {
        text: '请假情况',
        left: 'center'
    },
    tooltip: {
        trigger: 'item'
    },
    legend: {
        orient: 'vertical',
        left: 'left'
    },
    series: [
        {
            type: 'pie',
            radius: '50%',
            labelLine: {
                show: false
            },
            label: {
                show: false,
            },
            data: [
                { value: 0, name: '待销假' },
                { value: 0, name: '已核实返校' },
                { value: 0, name: '已申请销假' },
                { value: 0, name: '夜不归宿' },
            ],
            emphasis: {
                itemStyle: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
            }
        }
    ]
};

await buildAbsAdminEcharts().then(data => {
    absAdminPie_option.series[0].data[0].value = data.res2.count
    absAdminPie_option.series[0].data[1].value = data.res4.count
    absAdminPie_option.series[0].data[2].value = data.res3.count
    absAdminPie_option.series[0].data[3].value = data.res5.count
})

